Skip to content

Instantly share code, notes, and snippets.

@0xjac
0xjac / private_fork.md
Last active May 22, 2024 03:41
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@burak-kara
burak-kara / reset.gs
Last active May 22, 2024 03:41
Google Drive - Remove Sharing & Access Permissions from folders, subfolders and files. Note that Google Apps Script commands can be changed after this version.
// Note that this script will remove all permissions of all files and subfolders
// (including files in subfolders) of the given folder
// https://drive.google.com/drive/folders/abcdefgh
const id = "abcdefgh";
function start() {
const folder = DriveApp.getFolderById(id);
getSubFolders(folder);
// At the end, reset for parent folder
@realvjy
realvjy / ChoasLinesShader.metal
Last active May 22, 2024 03:39
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@binji
binji / notes.md
Created November 25, 2022 05:14
Compiling LLVM/Clang for Wasm notes
  • How to Cross Compile LLVM: https://llvm.org/docs/HowToCrossCompileLLVM.html
  • Building LLVM with CMake: https://llvm.org/docs/CMake.html
  • Hints from wasi-sdk Makefile: https://github.com/CraneStation/wasi-sdk/blob/master/Makefile
  • Try compiling natively (needed for llvm-tblgen and clang-tblgen)
    • cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;WebAssembly" -DLLVM_ENABLE_PROJECTS="lld;clang" ../llvm
  • Try building LLVM with WASI:
  • cmake -G Ninja -DCMAKE_AR=”/usr/local/google/home/binji/dev/llvm-project/build/bin/llvm-ar” -DCMAKE_RANLIB=”/usr/local/google/home/binji/dev/llvm-project/build/bin/llvm-ranlib” -DCMAKE_C_COMPILER="/usr/local/google/home/binji/dev/wasi-sdk-5.0/opt/wasi-sdk/bin/clang" -DCMAKE_CXX_COMPILER="/usr/local/google/home/binji/dev/wasi-sdk-5.0/opt/wasi-sdk/bin/clang++" -DCMAKE_CROSSCOMPILING=True -DCMAKE_INSTALL_PREFIX=/usr/local/google/home/binji/dev/wasi-clang -DLLVM_TABLEGEN=/usr/local/google/home/binji/dev/llvm-project/build/bin/llvm-tblgen -DCLANG_TABLEGEN=/
@colinrubbert
colinrubbert / getAllGlobals.js
Created August 23, 2023 14:44
Get all runtime global variables set by the app
/**
* RuntimeGlobalsChecker
*
* You can use this utility to quickly check what variables have been added (or
* leaked) to the global window object at runtime (by JavaScript code).
* By running this code, the globals checker itself is attached as a singleton
* to the window object as "__runtimeGlobalsChecker__".
* You can check the runtime globals programmatically at any time by invoking
* "window.__runtimeGlobalsChecker__.getRuntimeGlobals()".
*
@siralam
siralam / ATR_RSI_MACD.pine
Last active May 22, 2024 03:34
TradingView: ATR + RSI + MACD
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © szewa1992
//@version=4
study("MACD + ATR + RSI", resolution="", overlay=false)
displayATR = input(title="Display ATR?", type=input.bool, defval=true)
displayRSI = input(title="Display RSI?", type=input.bool, defval=false)
displayMACD = input(title="Display MACD?", type=input.bool, defval=true)
@korakot
korakot / neo4j.py
Last active May 22, 2024 03:30
Using Neo4j in Colab
# download 3.5.8 or neo4j-enterprise-4.0.0-alpha09mr02-unix
!curl https://neo4j.com/artifact.php?name=neo4j-community-3.5.8-unix.tar.gz -o neo4j.tar.gz
# decompress and rename
!tar -xf neo4j.tar.gz # or --strip-components=1
!mv neo4j-community-3.5.8 nj
# disable password, and start server
!sed -i '/#dbms.security.auth_enabled/s/^#//g' nj/conf/neo4j.conf
!nj/bin/neo4j start
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 22, 2024 03:29
set -e, -u, -o, -x pipefail explanation
@bbirec
bbirec / util.sql
Last active May 22, 2024 03:29
Postgres 유용한 query모음.
-- auto vaccum이 되었던 시간과 개수
select relname, autovacuum_count, last_autovacuum::timestamp with time zone at time zone 'Asia/Seoul' from pg_stat_all_tables where last_autovacuum is not null order by last_autovacuum desc limit 20;
-- 현재 실행중인 query
SELECT pid,query,now()-query_start as diff,query_start,state_change FROM pg_stat_activity where state='active' order by query_start desc;
-- 실행중인 pid kill
SELECT pg_terminate_backend(
--pid
@hbsdev
hbsdev / clean_py.sh
Last active May 22, 2024 03:27 — forked from joelverhagen/clean_py.sh
Recursively remove all .pyc files and __pycache__ directories in the current directory.
#!/bin/sh
# recursively removes all .pyc files and __pycache__ directories in the current
# directory
find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf